<script setup>
import { MAP } from './const'

function handleClick(link) {
  navigateTo(link)
}
</script>

<template>
  <ul class="nav-warp">
    <li v-for="item in MAP" :key="item.imgUrl" class="nav-item" @click="handleClick(item.link)">
      <img class="w-327px h-142px ml-17px" :src="`/images/nav/${item.imgUrl}.png`" :alt="item.name" />
      <img v-if="item.icon" class="nav-icon" :src="`/images/nav/${item.icon}.png`" alt="" :style="{ width: `${item.iconWidth}px` }" />
    </li>
  </ul>
</template>

<style lang="scss" scoped>
.nav-warp {
  display: flex;
  flex-wrap: wrap;
  height: 356px;
  padding: 20px 0 40px 0px;
  .nav-item {
    width: 327px;
    height: 142px;
    display: flex;
    align-items: center;
    margin: 0 10px 20px 0;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    &:nth-child(3) {
      margin: 0 0 20px 0;
    }
    .nav-icon {
      position: absolute;
      top: -15px;
      left: 15px;
    }
  }
}
</style>
